libcap-ng: add host build
authorCedric CHEDALEUX <[email protected]>
Mon, 24 Feb 2025 14:45:11 +0000 (15:45 +0100)
committerChristian Marangi <[email protected]>
Tue, 11 Nov 2025 15:27:09 +0000 (16:27 +0100)
This patch adds the necessary host build infrastructure for libcap-ng.

While OpenWrt doesn't strictly need this right now, merging this change
prevents downstream projects (like prplOS) from having to fork the package
just to build their host tools, thus keeping the code bases closer.

Signed-off-by: Cedric CHEDALEUX <[email protected]>
libs/libcap-ng/Makefile

index fc0e960c17a76569e9d3bc307f3203382c95f45a..0c22777c2fe7a1c3af73f09c5987e188f32baade 100644 (file)
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=libcap-ng
 PKG_VERSION:=0.8.4
-PKG_RELEASE:=1
+PKG_RELEASE:=2
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=https://people.redhat.com/sgrubb/libcap-ng
@@ -26,6 +26,7 @@ PKG_FIXUP:=autoreconf
 PKG_BUILD_FLAGS:=lto
 
 include $(INCLUDE_DIR)/package.mk
+include $(INCLUDE_DIR)/host-build.mk
 
 define Package/libcap-ng/Default
   TITLE:=POSIX capabilities library
@@ -65,6 +66,15 @@ CONFIGURE_ARGS += \
     --without-python \
     --without-python3
 
+HOST_CONFIGURE_VARS += \
+    ac_cv_prog_swig_found=no
+
+HOST_CONFIGURE_ARGS += \
+    --without-python \
+    --without-python3
+
+HOST_PKG_BUILD_FLAGS:=lto
+
 define Build/InstallDev
        $(INSTALL_DIR) $(1)/usr/include
        $(CP) $(PKG_INSTALL_DIR)/usr/include/*.h $(1)/usr/include/
@@ -89,3 +99,4 @@ endef
 
 $(eval $(call BuildPackage,libcap-ng))
 $(eval $(call BuildPackage,libcap-ng-bin))
+$(eval $(call HostBuild))